# Sample Plugin: Template Tag (localization)
#

package MT::Plugin::MyPlugin03;

use strict;
use MT;
use MT::Template::Context;
use vars qw($VERSION);
$VERSION = '0.2';

@MT::Plugin::MyPlugin03::ISA = qw(MT::Plugin);

my $plugin = new MT::Plugin::MyPlugin03({
    name => '<MT_TRANS phrase=\'Sample Plugin: Welcome\'>',
    version => $VERSION,
    description => '<MT_TRANS phrase=\'_PLUGIN_DESCRIPTION\'>',
    author_name => '<MT_TRANS phrase=\'_PLUGIN_AUTHOR\'>',
    author_link => 'http://www.example.com/about/',
    doc_link => 'http://www.example.com/docs/',
    l10n_class => 'MyPlugin03::L10N',
});
MT->add_plugin($plugin);

MT::Template::Context->add_tag(Welcome => \&welcome);
 
sub welcome {
    my $cfg = MT::ConfigMgr->instance;
    MT->set_language($cfg->DefaultLanguage);
    return $plugin->translate('Welcome to Movable Type!');
}

1;
